% fn_sort_p.m

% Puts prices into a z x 5 vector, where z is the number of prices.  
% In the matrix, the first column is the actual price.
% The second column is the convenience dummy.
% The third column is the classification code by location.
% The fourth column is the classification code by product.
% The fifth column is the tax not included dummy.

function [prices] = fn_sort_p(data);

global conv_codes 

prices = [];
conv_codes = [];
[rows,cols] = size(data);
for c = 3:cols
    for r = 5:rows
        if data(r,c) > 0
            prices = [prices; data(r,c) data(1,c) data(2,c) data(r,1) data(r,2)];
            conv_codes = [conv_codes; data(3,c)];
        end;
    end;
end;